package freespiritsocial.io.user.ui.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import freespiritsocial.io.user.R
import freespiritsocial.io.user.databinding.ItemAddMediaBinding
import freespiritsocial.io.user.ext.setAdapterAnimation
import java.util.*

/**
 * 添加图片适配器
 */
class AddMediaAdapter(
    data: ArrayList<String> = arrayListOf(),
    layoutResIdRes: Int = R.layout.item_add_media
):
    BaseQuickAdapter<String,BaseDataBindingHolder<ItemAddMediaBinding>>(layoutResIdRes,data) {
    init {
        addChildClickViewIds(R.id.tv_add_media,R.id.iv_close)

        setAdapterAnimation(0)
    }

    override fun convert(holder: BaseDataBindingHolder<ItemAddMediaBinding>,item: String) = with(holder.dataBinding) {
        this?.url = item
    }
}